package com.intramirror.product.mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * Created on 2018/6/7.
 *
 * @author yfding
 */
@Mapper
public interface ProductDiscountMapper {

    Map<String, Object> getProduct(@Param("productId") Long productId);

    Long getPriceChangeRule(@Param("seasonCode") String seasonCode, @Param("categoryType") Long categoryType, @Param("priceType") Long priceType,
            @Param("vendorId") Long vendorId);

    Long getImPriceAlgorithm(@Param("seasonCode") String seasonCode, @Param("categoryType") Long categoryType, @Param("vendorId") Long vendorId);

    Long getCategoryType(@Param("categoryId") Long categoryId);

    Long getBurstingByProductIdCount(@Param("productId") Long productId);

    Long getBurstingByTagCount(@Param("tagId") Long tagId);

    Integer getProductDiscount(@Param("priceChangeRuleId") Long priceChangeRuleId, @Param("productId") Long productId);

    Integer getProductGroupDiscount(@Param("priceChangeRuleId") Long priceChangeRuleId, @Param("tagId") Long tagId);

    Integer getThreeCategoryDiscount(@Param("priceChangeRuleId") Long priceChangeRuleId, @Param("brandId") Long brandId, @Param("categoryId") Long categoryId);

    Integer getSecondCategoryDiscount(@Param("priceChangeRuleId") Long priceChangeRuleId, @Param("brandId") Long brandId, @Param("categoryId") Long categoryId);

    Integer getBoutiqueDefaultDiscount();

    Integer getImDefaultDiscount();

    List<Map<String, Object>> getTodayDiscount();

    Integer updateProductPrice(@Param("inDiscount") int inDiscount, @Param("imDiscount") int imDiscount, @Param("productId") Long productId);

    Integer updateProductSeasonCodeById(@Param("productId") Long productId, @Param("seasonCode") String seasonCode);

    Integer updateProductPriceById(@Param("productId") Long productId, @Param("retailPrice") BigDecimal retailPrice);
}
